package cn.lotusnut.esdemo.controller;

import cn.lotusnut.esdemo.entity.Goods;
import cn.lotusnut.esdemo.mappeer.GoodsMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Resource
    private GoodsMapper goodsMapper;

    @GetMapping("/all")
    public Iterable<Goods> all() {
        Iterable<Goods> goods = goodsMapper.findAll();
        return goods;
    }
}
